package com.example.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication(scanBasePackages = "com.example.demo")
public class Demo1Application implements CommandLineRunner {

	@Autowired
	private ApplicationContext context;

	public static void main(String[] args) {
		SpringApplication.run(Demo1Application.class, args);

	}

	@Override
	public void run(String... args) throws Exception {
		// 检查 UserMapper Bean 是否存在
//		System.out.println("UserMapper Bean: " + context.getBean(UserMapper.class));
//		System.out.println("UserUtil Bean: " + context.getBean(UserUtil.class));
	}
}
